<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script src="./Promise.js"></script>
  <script>
    let p = new Promise((resolve, reject) => {
      //同步任务的情况
      reject('Error');
      resolve('OK');
      // throw '出问题啦~~';
    });

    p.then(value => {
      console.log(value);
    }, reason => {
      console.warn(reason);
    })

  </script>
</body>
</html>